﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using rock.UI.common;
using rock.DAL;

namespace rock.UI.houseinfo
{
    public partial class UserControlHouseRentInfo : UserControl
    {
        DalHOUSE_ROOM dal = new DalHOUSE_ROOM();
        public UserControlHouseRentInfo()
        {
            InitializeComponent();
            this.userControlLeftTree1.selectedTreeinfo = selectedTreeinfo;
        }
        int XiaoQuSeqid = 0;
        int DongSeqid = 0;
        private void selectedTreeinfo(TreeInfo treeinfo)
        {
            if (treeinfo.NodeType == 0)
            {
                this.XiaoQuSeqid = 0;
                this.DongSeqid = 0;
            }
            else if (treeinfo.NodeType == 1)
            {
                this.XiaoQuSeqid = treeinfo.Id;
                this.DongSeqid = 0;
            }
            else if (treeinfo.NodeType == 2)
            {
                this.XiaoQuSeqid = 0;
                this.DongSeqid = treeinfo.Id;
            }
            
            this.refreshData(1);
        }

        //刷新数据
        public void refreshData(int goPage)
        {


           
             

            StringBuilder where = new StringBuilder(" 1 = 1");
            if (XiaoQuSeqid > 0)
            {
                where.Append(" AND TEMP.XIAOQU_SEQID =  " + XiaoQuSeqid);
            }
            if (DongSeqid > 0)
            {
                where.Append(" AND TEMP.DONG_SEQID =  " + DongSeqid);
            }
            

            //this.STATUS.DataSource = Constant.HOUSE_ROOM_STATUS_LIST;

            PageDataSet ds = dal.GetListByPage(where.ToString(), " SEQID DESC ", 1, 200);
            //画树
        }
    }
}
